package gtkwire.widget;

import gtkwire.*;
import java.awt.Color;

/**
*A dialog box for selecting fonts.
*/
public class GtkFontSelectionDialog extends GtkDialog
{
	private String fsTitle;

	public GtkFontSelectionDialog( String title )
	{
		super();
		this.widgetType = WT_GtkFontSelectionDialog;
		this.fsTitle = title;
	}

	public GtkFontSelectionDialog( String name, GladeKey key )
	{
		super( name, key );
		this.widgetType = WT_GtkFontSelectionDialog;
	}

	protected String[] getCreateData()	
	{
		if( fsTitle == null ) return null;
		String[] msg = { fsTitle };
		return msg;
	}

	/**
	*Retrieves the name of the currently selected font.
	*/
	public String getSelectedFont()
	{
		GTKWireMessage answer = app().sendCommandRequest( name, widgetType, GTKWireCommandRequest.GET_SELECTED_FONT, null );
		return (String) answer.getMessageObject();
	}

}//end class